Clearing the Address Bar List
Another
part of Internet Explorer’s AutoComplete feature involves the web
addresses that you type into the address bar. When you start typing a
URL into the address bar, Internet Explorer displays a list of
addresses that match what you’ve typed. If you see the one you want,
use the arrow keys to select it, and then press Enter to surf to it.
That’s
mighty convenient, but not very private because other people who have
access to your PC can also see those addresses. So another excellent
way to enhance your privacy is to clear the address bar list so that no
URLs appear as you type.
One
way to clear the address bar list is to clear the history files, as
described in the previous section. That is, you select Safety, Delete
Browsing History, activate the History check box, deactivate all the
other check boxes, and then click Delete.
Note
You
can configure Internet Explorer to not save the web addresses that you
type. Select Tools, Internet Options, select the Content tab, and then
click Settings in the AutoComplete group. In the AutoComplete Settings
dialog box, deactivate the Address Bar check box to stop saving typed
URLs. Click OK in all open dialog boxes.
That
works well, but it also means that you lose all your browsing history.
That might be exactly what you want, but you may prefer to preserve the
history files. In this section, I show you a script that removes the
address bar URLs but lets you save your history.
First, note that Internet Explorer stores the last 25 typed URLs in the following Registry key (see Figure 3):
HKCU\Software\Microsoft\Internet Explorer\TypedURLs
You can therefore clear the address bar list by closing all Internet Explorer windows and deleting the settings url1 through url25 in this key. Listing 1 presents a script that does this for you.
Listing 1. A Script That Deletes Internet Explorer’s Typed URLs
Option Explicit Dim objWshShell, nTypedURLs, strRegKey, strURL, i Set objWshShell = WScript.CreateObject("WScript.Shell") On Error Resume Next ' ' First determine the number of typed URLs in the Registry ' nTypedURLs = 0 strRegKey = "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\" Do While True ' ' Read the next typed URL ' strURL = objWshShell.RegRead(strRegKey & "url" & nTypedURLs + 1) ' ' If we get an error, it means we've read all ' the typed URLs, so exit the loop If Err <> 0 Then Exit Do End If nTypedURLs = nTypedURLs + 1 Loop ' ' Run through the typed URLs ' For i = 1 to nTypedURLs ' ' Delete the Registry setting ' objWshShell.RegDelete strRegKey & "url" & i Next 'i objWshShell.Popup "Finished deleting " & nTypedURLs & _ " typed URLs", , "Delete Typed URLs"
|
This script begins by running through all the settings in the TypedURLs
key, and counts them as it goes. This is necessary because there may
not be the full 25 typed URLs in the key, and if you try to delete a
nonexistent Registry key, you get an error. With the number of typed
URLs in hand, the script then performs a second loop that deletes each
Registry setting.